plot_pandas_GUI()¶You can try this notebook live by lauching it in Binder.This can take a while to launch, be patient.
.
First we import pandas and pandas_GUI, and load some data. In this case we will load two time dependent Laser Induced Fluorescence (LIF) data sets.
import pandas as pd
from pandas_GUI import *
LIF = pd.read_csv('DataSets/LIF.csv')
LIF2 = pd.read_csv('DataSets/LIF2.csv')
This is the plot made in the step-by-step example.
# CODE BLOCK generated using plot_pandas_GUI(). See https://github.com/JupyterPhysSciLab/jupyter_Pandas_GUI.
from plotly import graph_objects as go
Figure_1 = go.FigureWidget(layout_template="simple_white")
scat = go.Scatter(x = LIF['time(s)'], y = LIF['Signal (V)'],
mode = 'lines', name = 'LIF1',)
Figure_1.add_trace(scat)
scat = go.Scatter(x = LIF2['time(s)'], y = LIF2['Signal (V)'],
mode = 'lines', name = 'LIF2',)
Figure_1.add_trace(scat)
Figure_1.update_xaxes(title= 'Time (s)', mirror = True)
Figure_1.update_yaxes(title= 'Signal (V)', mirror = True)
Figure_1.update_layout(title = 'Figure_1', template = 'simple_white')
Figure_1.show()
# Force save widget states so that graph will still be
# available when notebook next opened in trusted state.
JPSLUtils.OTJS('Jupyter.actions.call("widgets:save-with-widgets");')
Figure 1: This should display a live plotly plot that can be zoomed and show point values upon hovering. If you do not see a live plot the notebook is not running or trusted. Click on the 'Not Trusted' button in the Jupyter menu bar to trust the notebook.
The plot styling options impact font, background, framing and color choices.
An image of the plot styling section (Tab 3) is shown below.

Display Mirror Axes creates a frame all the way around the plot.Mirror Tick Marks adds tick marks to the right and top axes.Plot Styling popup. Options are simple_white, ggplot2, seaborn, plotly, plotly_white, plotly_dark, presentation (bigger fonts), xgridoff, ygridoff, gridon, simple_white+presentation, simple_white+gridon, simple_white+presentation+gridon. The options available are a subset of all the plotly options. If you want slightly different format options you can edit the code created by the GUI and run it again.
No mirroring of axes or tick marks
# CODE BLOCK generated using plot_pandas_GUI(). See https://github.com/JupyterPhysSciLab/jupyter_Pandas_GUI.
from plotly import graph_objects as go
Figure_2 = go.FigureWidget(layout_template="simple_white")
scat = go.Scatter(x = LIF['time(s)'], y = LIF['Signal (V)'],
mode = 'lines', name = 'LIF 1',)
Figure_2.add_trace(scat)
Figure_2.update_xaxes(title= 'Time (s)')
Figure_2.update_yaxes(title= 'Signal (V)')
Figure_2.update_layout(title = 'Default Plot Styling', template = 'simple_white')
Figure_2.show()
# Force save widget states so that graph will still be
# available when notebook next opened in trusted state.
JPSLUtils.OTJS('Jupyter.actions.call("widgets:save-with-widgets");')
Figure 2: Example of the default styling.
# CODE BLOCK generated using plot_pandas_GUI(). See https://github.com/JupyterPhysSciLab/jupyter_Pandas_GUI.
from plotly import graph_objects as go
Figure_3 = go.FigureWidget(layout_template="simple_white")
scat = go.Scatter(x = LIF['time(s)'], y = LIF['Signal (V)'],
mode = 'lines', name = 'LIF 1',)
Figure_3.add_trace(scat)
Figure_3.update_xaxes(title= 'Time (s)', mirror= 'ticks')
Figure_3.update_yaxes(title= 'Signal (V)', mirror= 'ticks')
Figure_3.update_layout(title = 'Mirror Axes with Ticks', template = 'simple_white')
Figure_3.show()
# Force save widget states so that graph will still be
# available when notebook next opened in trusted state.
JPSLUtils.OTJS('Jupyter.actions.call("widgets:save-with-widgets");')
Figure 3: Example of mirroring axes with tick marks.
# CODE BLOCK generated using plot_pandas_GUI(). See https://github.com/JupyterPhysSciLab/jupyter_Pandas_GUI.
from plotly import graph_objects as go
Figure_4 = go.FigureWidget(layout_template="simple_white")
scat = go.Scatter(x = LIF['time(s)'], y = LIF['Signal (V)'],
mode = 'lines', name = 'LIF 1',)
Figure_4.add_trace(scat)
Figure_4.update_xaxes(title= 'Time (s)')
Figure_4.update_yaxes(title= 'Signal (V)')
Figure_4.update_layout(title = 'ggplot2 Styling', template = 'ggplot2')
Figure_4.show()
# Force save widget states so that graph will still be
# available when notebook next opened in trusted state.
JPSLUtils.OTJS('Jupyter.actions.call("widgets:save-with-widgets");')
Figure 4: Example of ggplot2 styling.
# CODE BLOCK generated using plot_pandas_GUI(). See https://github.com/JupyterPhysSciLab/jupyter_Pandas_GUI.
from plotly import graph_objects as go
Figure_4 = go.FigureWidget(layout_template="simple_white")
scat = go.Scatter(x = LIF['time(s)'], y = LIF['Signal (V)'],
mode = 'lines', name = 'LIF 1',)
Figure_4.add_trace(scat)
Figure_4.update_xaxes(title= 'Time (s)')
Figure_4.update_yaxes(title= 'Signal (V)')
Figure_4.update_layout(title = 'seaborn Styling', template = 'seaborn')
Figure_4.show()
# Force save widget states so that graph will still be
# available when notebook next opened in trusted state.
JPSLUtils.OTJS('Jupyter.actions.call("widgets:save-with-widgets");')
Figure 5: Example of seaborn styling.
# CODE BLOCK generated using plot_pandas_GUI(). See https://github.com/JupyterPhysSciLab/jupyter_Pandas_GUI.
from plotly import graph_objects as go
Figure_4 = go.FigureWidget(layout_template="simple_white")
scat = go.Scatter(x = LIF['time(s)'], y = LIF['Signal (V)'],
mode = 'lines', name = 'LIF 1',)
Figure_4.add_trace(scat)
Figure_4.update_xaxes(title= 'Time (s)')
Figure_4.update_yaxes(title= 'Signal (V)')
Figure_4.update_layout(title = 'plotly Styling', template = 'plotly')
Figure_4.show()
# Force save widget states so that graph will still be
# available when notebook next opened in trusted state.
JPSLUtils.OTJS('Jupyter.actions.call("widgets:save-with-widgets");')
Figure 6: Example of plotly styling.
# CODE BLOCK generated using plot_pandas_GUI(). See https://github.com/JupyterPhysSciLab/jupyter_Pandas_GUI.
from plotly import graph_objects as go
Figure_4 = go.FigureWidget(layout_template="simple_white")
scat = go.Scatter(x = LIF['time(s)'], y = LIF['Signal (V)'],
mode = 'lines', name = 'LIF 1',)
Figure_4.add_trace(scat)
Figure_4.update_xaxes(title= 'Time (s)')
Figure_4.update_yaxes(title= 'Signal (V)')
Figure_4.update_layout(title = 'plotly_white Styling', template = 'plotly_white')
Figure_4.show()
# Force save widget states so that graph will still be
# available when notebook next opened in trusted state.
JPSLUtils.OTJS('Jupyter.actions.call("widgets:save-with-widgets");')
Figure 7: Example of plotly_white styling.
# CODE BLOCK generated using plot_pandas_GUI(). See https://github.com/JupyterPhysSciLab/jupyter_Pandas_GUI.
from plotly import graph_objects as go
Figure_4 = go.FigureWidget(layout_template="simple_white")
scat = go.Scatter(x = LIF['time(s)'], y = LIF['Signal (V)'],
mode = 'lines', name = 'LIF 1',)
Figure_4.add_trace(scat)
Figure_4.update_xaxes(title= 'Time (s)')
Figure_4.update_yaxes(title= 'Signal (V)')
Figure_4.update_layout(title = 'plotly_dark Styling', template = 'plotly_dark')
Figure_4.show()
# Force save widget states so that graph will still be
# available when notebook next opened in trusted state.
JPSLUtils.OTJS('Jupyter.actions.call("widgets:save-with-widgets");')
Figure 8: Example of plotly_dark styling.
# CODE BLOCK generated using plot_pandas_GUI(). See https://github.com/JupyterPhysSciLab/jupyter_Pandas_GUI.
from plotly import graph_objects as go
Figure_4 = go.FigureWidget(layout_template="simple_white")
scat = go.Scatter(x = LIF['time(s)'], y = LIF['Signal (V)'],
mode = 'lines', name = 'LIF 1',)
Figure_4.add_trace(scat)
Figure_4.update_xaxes(title= 'Time (s)')
Figure_4.update_yaxes(title= 'Signal (V)')
Figure_4.update_layout(title = 'presentation Styling', template = 'presentation')
Figure_4.show()
# Force save widget states so that graph will still be
# available when notebook next opened in trusted state.
JPSLUtils.OTJS('Jupyter.actions.call("widgets:save-with-widgets");')
Figure 9: Example of presentation styling.
# CODE BLOCK generated using plot_pandas_GUI(). See https://github.com/JupyterPhysSciLab/jupyter_Pandas_GUI.
from plotly import graph_objects as go
Figure_4 = go.FigureWidget(layout_template="simple_white")
scat = go.Scatter(x = LIF['time(s)'], y = LIF['Signal (V)'],
mode = 'lines', name = 'LIF 1',)
Figure_4.add_trace(scat)
Figure_4.update_xaxes(title= 'Time (s)')
Figure_4.update_yaxes(title= 'Signal (V)')
Figure_4.update_layout(title = 'xgridoff Styling', template = 'xgridoff')
Figure_4.show()
# Force save widget states so that graph will still be
# available when notebook next opened in trusted state.
JPSLUtils.OTJS('Jupyter.actions.call("widgets:save-with-widgets");')
Figure 10: Example of xgridoff styling.
# CODE BLOCK generated using plot_pandas_GUI(). See https://github.com/JupyterPhysSciLab/jupyter_Pandas_GUI.
from plotly import graph_objects as go
Figure_4 = go.FigureWidget(layout_template="simple_white")
scat = go.Scatter(x = LIF['time(s)'], y = LIF['Signal (V)'],
mode = 'lines', name = 'LIF 1',)
Figure_4.add_trace(scat)
Figure_4.update_xaxes(title= 'Time (s)')
Figure_4.update_yaxes(title= 'Signal (V)')
Figure_4.update_layout(title = 'ygridoff Styling', template = 'ygridoff')
Figure_4.show()
# Force save widget states so that graph will still be
# available when notebook next opened in trusted state.
JPSLUtils.OTJS('Jupyter.actions.call("widgets:save-with-widgets");')
Figure 11: Example of ygridoff styling.
# CODE BLOCK generated using plot_pandas_GUI(). See https://github.com/JupyterPhysSciLab/jupyter_Pandas_GUI.
from plotly import graph_objects as go
Figure_4 = go.FigureWidget(layout_template="simple_white")
scat = go.Scatter(x = LIF['time(s)'], y = LIF['Signal (V)'],
mode = 'lines', name = 'LIF 1',)
Figure_4.add_trace(scat)
Figure_4.update_xaxes(title= 'Time (s)')
Figure_4.update_yaxes(title= 'Signal (V)')
Figure_4.update_layout(title = 'gridon Styling', template = 'gridon')
Figure_4.show()
# Force save widget states so that graph will still be
# available when notebook next opened in trusted state.
JPSLUtils.OTJS('Jupyter.actions.call("widgets:save-with-widgets");')
Figure 12: Example of gridon styling. Since it is not combined with another style it looks just like plotly_white.
# CODE BLOCK generated using plot_pandas_GUI(). See https://github.com/JupyterPhysSciLab/jupyter_Pandas_GUI.
from plotly import graph_objects as go
Figure_4 = go.FigureWidget(layout_template="simple_white")
scat = go.Scatter(x = LIF['time(s)'], y = LIF['Signal (V)'],
mode = 'lines', name = 'LIF 1',)
Figure_4.add_trace(scat)
Figure_4.update_xaxes(title= 'Time (s)')
Figure_4.update_yaxes(title= 'Signal (V)')
Figure_4.update_layout(title = 'simple_white+presentation Styling', template = 'simple_white+presentation')
Figure_4.show()
# Force save widget states so that graph will still be
# available when notebook next opened in trusted state.
JPSLUtils.OTJS('Jupyter.actions.call("widgets:save-with-widgets");')
Figure 13: Example of simple_white+presentation styling.
# CODE BLOCK generated using plot_pandas_GUI(). See https://github.com/JupyterPhysSciLab/jupyter_Pandas_GUI.
from plotly import graph_objects as go
Figure_4 = go.FigureWidget(layout_template="simple_white")
scat = go.Scatter(x = LIF['time(s)'], y = LIF['Signal (V)'],
mode = 'lines', name = 'LIF 1',)
Figure_4.add_trace(scat)
Figure_4.update_xaxes(title= 'Time (s)')
Figure_4.update_yaxes(title= 'Signal (V)')
Figure_4.update_layout(title = 'simple_white+gridon Styling', template = 'simple_white+gridon')
Figure_4.show()
# Force save widget states so that graph will still be
# available when notebook next opened in trusted state.
JPSLUtils.OTJS('Jupyter.actions.call("widgets:save-with-widgets");')
Figure 14: Example of simple_white+gridon styling. This is essentially the same as plotly_white.
# CODE BLOCK generated using plot_pandas_GUI(). See https://github.com/JupyterPhysSciLab/jupyter_Pandas_GUI.
from plotly import graph_objects as go
Figure_4 = go.FigureWidget(layout_template="simple_white")
scat = go.Scatter(x = LIF['time(s)'], y = LIF['Signal (V)'],
mode = 'lines', name = 'LIF 1',)
Figure_4.add_trace(scat)
Figure_4.update_xaxes(title= 'Time (s)')
Figure_4.update_yaxes(title= 'Signal (V)')
Figure_4.update_layout(title = 'simple_white+presentation+gridon Styling', template = 'simple_white+presentation+gridon')
Figure_4.show()
# Force save widget states so that graph will still be
# available when notebook next opened in trusted state.
JPSLUtils.OTJS('Jupyter.actions.call("widgets:save-with-widgets");')
Figure 15: Example of simple_white+presentation+gridon styling.
In addition to trying it below if this is a live notebook, you can look at the other examples listed in the Pandas GUI website.
If you are running this notebook live in binder you can try it here by running the first cell to import the tools and data. Then run the cell below to create the GUI. Note: You may want to expand the collapsed instructions to learn more about each tab.
plot_pandas_GUI()